/**
 * 支付管理 支付配置信息
 */
<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/userInfo/userInfo' }">首页</el-breadcrumb-item>

      <el-breadcrumb-item>房间管理</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 搜索筛选 -->
    <el-form :inline="true" :model="pageparm" class="user-search">
      <el-form-item label="搜索：">
        <el-input
          size="small"
          v-model="liveCode"
          placeholder="请输入关键字"
          @change="search"
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button
          size="small"
          type="primary"
          icon="el-icon-search"
          @click="search"
          >搜索</el-button
        >
      </el-form-item>
    </el-form>
    <!--列表-->
    <el-table
      size="small"
      :data="rootDataList"
      stripe
      highlight-current-row
      v-loading="loading"
      border
      element-loading-text="拼命加载中"
      style="width: 100%; text-align: center"
      :header-cell-style="{ 'text-align': 'center' }"
      :cell-style="{ 'text-align': 'center' }"
    >
      <el-table-column align="center" type="ion" width="60">
      </el-table-column>
      <el-table-column align="center" prop="coverImg" label="封面图">
        <template slot-scope="scope">
          <img
            :src="scope.row.coverImg"
            style="width: 40px; heigth: 40px"
            alt=""
          />
        </template>
      </el-table-column>
      <el-table-column prop="liveCode" label="房间号" width="200">
      </el-table-column>
      <el-table-column prop="nickname" label="厅主昵称" width="200">
      </el-table-column>
      <el-table-column prop="categoryName" label="类目名称" width="200">
      </el-table-column>
      <el-table-column align="center" prop="status" label="状态">
        <template slot-scope="scope">
          <div v-if="scope.row.status == 1">开播</div>
          <div v-if="scope.row.status == 2">下播</div>
          <div v-if="scope.row.status == 3">封禁</div>
        </template>
      </el-table-column>
      <el-table-column align="center" label="操作" min-width="300">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleEdit(scope.row)"
            >查看流水</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <Pagination
      v-bind:child-msg="pageparm"
      @callFather="callFather"
    ></Pagination>
  </div>
</template>

<script>
import { rootList } from "@/api/root";
import Pagination from "../../components/Pagination";
export default {
  data() {
    return {
      rootDataList: [],
      loading: false, //是显示加载
      userparm: [], //搜索权限
      listData: [], //用户数据
      // 分页参数
      pageparm: {
        current: 1,
        size: 10,
        total: 10,
        liveCode: "",
      },
    };
  },
  // 注册组件
  components: {
    Pagination,
  },
  /**
   * 数据发生改变
   */

  /**
   * 创建完毕
   */
  created() {
    this.getRootList();
  },

  /**
   * 里面的方法只有被调用才会执行
   */
  methods: {
    getRootList() {
      this.loading = true;
      rootList(this.pageparm).then((res) => {
        this.rootDataList = res.data.data;
        this.pageparm.total = Number(res.data.total);
        this.loading = false;
      });
    },
    // 分页插件事件
    callFather(parm) {
      console.log(parm);
      this.pageparm.current = parm.currentPage || 1;
      this.pageparm.size = parm.pageSize || 10;
      this.getRootList();
    },
    // 搜索事件
    search() {
      this.getRootList();
    },
    //房间流水
    handleEdit: function (row) {
      console.log(row, "房间信息");
      this.$router.push("/rootTurnover/rootTurnover");
    },
  },
};
</script>

<style scoped>
.user-search {
  margin-top: 20px;
}
.userRole {
  width: 100%;
}
</style>

 
 